﻿@model  P2PWeb.Models.Pager<P2PWeb.Models.Campaign>
@using P2PWeb.Controllers;
@using P2PWeb.Common
@using P2PWeb;
<table cellpadding="0" cellspacing="0" width="100%">
    <tbody>
        <tr class="total_th">
            <th class="name">借款单号</th>
            <th>借款金额</th>
            <th>借款期限</th>
            <th>下单时间</th>
            <th>订单状态</th>
            <th class="last_th"></th>
        </tr>
        <tr class="">
            <th colspan="6">&nbsp;</th>
        </tr>

        @foreach (P2PWeb.Models.Campaign campaign in Model.Items)
        {
            <tr class="first_td">
                <td class="left_td">@campaign.ID
                </td>
                <td>@campaign.Amount.ToString("N2") 元</td>
                <td>@(campaign.DueDate.GetValueOrDefault().MonthDifference()+ "个月")
                </td>
                <td>@campaign.CreationTime.Value.ToString("yyyy-MM-dd hh:mm:ss")</td>
                <td class="red">@(((P2PWeb.Common.CampaignState)campaign.Status).GetDisplayName())</td>

                <td><a href="@("borrowsManager/BorrowDetail?borrowId="+campaign.ID)">查看详情</a></td>
            </tr>
        }
    </tbody>
</table>

<div id="navDiv" class="loan_page">

    <script>
        $(document).ready(function () {
            MakerNavs('borrowsManager','index',@Model.CurrentPageIndex,@Model.TotialPaqgerCount,@Model.Items.Count,@Model.TotialItemsCount,'navDiv','borrowsContainer');
        });
    </script>
</div>

